home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / a_utils / perl / jinx.lha / curses.pl next >
Perl Script  |  1993-08-13  |  1KB  |  49 lines

  1. #! /local/bin/perl
  2.  
  3. # curses.pl -- Copyright (c) 1990, Henk P. Penning.
  4. # You may distribute under the terms of the GNU General Public License
  5. # as specified in the README file that comes with the Jinx 2.1 kit.
  6.  
  7. sub addlog { &ctermlog($_[0]) if $logLevel >= 0 ; }
  8.  
  9. sub getchintR { return &ch2str(&getchR) ; }
  10.  
  11. sub initEdit
  12.   { local($_) ;
  13.     &editreset ;
  14.     for ( @_ ) { &editq($_) ; }
  15.   }
  16.  
  17. sub initCurses
  18.   { &initscr ;
  19.     &nonl ;
  20.     &cbreak ;
  21.     &noecho ;
  22.     &keypad(0,1) ;
  23.     &leaveok(0,0) ;
  24.     $flushOn = 1 ;
  25.   }
  26.  
  27. sub testCurses
  28.   { local($_,@keys,@errors) ;
  29.     for ( ('keypad','beep','editl','editr') )
  30.       { if ( ! defined($curfun{$_}) )
  31.           { eval "sub $_ { ; }" ;
  32.         $curfun{$_} = 'EMPTY' ;
  33.       }
  34.       }
  35.     for ( @testCurses )
  36.       { push(@errors,"jinx: required cterm function '$_' is absent")
  37.       if ! defined $curfun{$_} ;
  38.       }
  39.     return $#errors == -1, @errors ;
  40.   }
  41.  
  42. @testCurses = ('addstr','beep'
  43. ,'cbreak','clrreg','clrtoeol','ctermlog','edit'
  44. ,'editl','editq','editr','editreset','endwin'
  45. ,'getchR','initscr','keypad','leaveok','move'
  46. ,'mvaddstr','noecho','nonl','show') ;
  47.  
  48. 1;
  49.